package com.cqhfan.mq.strategy;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

/**
 * @author 眭传洪
 * @create 2025-08-06 17:58
 */
@Slf4j
@RequiredArgsConstructor
public class RabbitMqMessageHelper implements MqMessageHelper {

    private final RabbitTemplate rabbitTemplate;

    @Override
    public void sendMessage(String exchange, String routingKey, Object msg) {
        log.debug("准备发送消息，exchange:{}, routingKey:{}, msg:{}", exchange, routingKey, msg);
        rabbitTemplate.convertAndSend(exchange, routingKey, msg);
    }

    @Override
    public void sendDelayMessage(String exchange, String routingKey, Object msg) {

    }
}
